import QtQuick
import QtQuick.Controls

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")

    SwipeView {
        id: swipeView
        anchors.fill: parent
        currentIndex: 1  // 默认显示第二个页面

        Page {
            Label {
                anchors.centerIn: parent
                text: "This is Page1"
            }
        }

        Page {
            Switch {
                anchors.centerIn: parent
                text: "Dark Mode"
            }
        }

        Page {
            Label {
                anchors.centerIn: parent
                text: "This is Page3"
            }
        }
    }

    PageIndicator {
        id: indicator
        anchors.bottomMargin: 20

        count: swipeView.count
        currentIndex: swipeView.currentIndex

        anchors.bottom: swipeView.bottom
        anchors.horizontalCenter: parent.horizontalCenter
    }
}
